package com.zxq.frame;

import com.zxq.frame.inner.WebPduData;
import com.zxq.factory.annotate.DecoderField;
import com.zxq.factory.annotate.EncoderField;
import com.zxq.factory.annotate.Frame;
import com.zxq.factory.enums.EField;
import com.zxq.factory.enums.ETrimMethod;
import lombok.Data;

@Frame(id = 2L,remark = "传感器协议")
@Data
public class TcpModBusFrame {

    //08 06  09 05  01 06  03 05 08 09 04 02 03 06 03
    //0806 0905 0106 000508090402030603
    @EncoderField(sequence = 1,note = "事务标识")
    @DecoderField(sequence = 1,note = "事务标识" )
    Integer transactionId = 0x0806;

    @EncoderField(sequence = 2,note = "协议标识")
    @DecoderField(sequence = 2,note = "协议标识")
    Integer protocolId = 0x0905;

    @EncoderField(sequence = 3,note = "数据长度")
    @DecoderField(sequence = 3,note = "数据长度" )
    Integer length;

    @EncoderField(sequence = 4,field = EField.Frame,note = "数据长度")
    @DecoderField(sequence = 4,field = EField.Frame,method = ETrimMethod.Tail,param = 0, note = "数据长度" )
    WebPduData webPduData;


}
